"DC3 LS, Fuck Hyundai, now and forever" (eg6)
06/10/2019 at 13:05 • Filed to: None | 2 | 7 |
So I finished the decision making program . I highly advise you not to look at the code. It’s very ugly and I assumed javascript would work much more like java and it absolutely does not . I still have no idea how floating point arithmetic is supposed to work in this godforsaken language. Plus I kind of slopped this together in like three days spread across a month.
Anyways. It’ll ask you what items you’d like to compare to each other (ie models of cars) and then what categories you’d like to compare them in (speed, handling, interior, whatever you want ). Then it’ll ask you some comparison questions between most categories and items . (about half as many as possible comparisons , if you prefer A to B by 6, it’ll assume you prefer B to A by -6 or 1/6.)
Just remember , if you have no preference in a comparison , answer 1. 1 is no preference, not zero. (Although it’ll change any zeros to ones).
Just download the linked document below and then run it in your browser . (Just opening it on google drive won’t run the script.)
!!! UNKNOWN CONTENT TYPE !!!
CalzoneGolem
> DC3 LS, Fuck Hyundai, now and forever
06/10/2019 at 13:12 | 1 |
Java gives me hives.
Future Heap Owner
> DC3 LS, Fuck Hyundai, now and forever
06/10/2019 at 13:13 | 1 |
It’s not all Javascript’s fault , floating point numbers are tricky because they’re trying to represent infinity different numbers with only a finite number of bits (but Javascript doesn’t let you use integers at all, which does suck). Never check for equality with floating point numbers, because they’re almost never going to be exactly equal; instead check that they’re “close enough” (e.g. differ by less than 0.0001, or whatever constant makes sense for your application, or a percentage).
Aremmes
> CalzoneGolem
06/10/2019 at 13:50 | 0 |
But this is JavaScript, which takes all of the bad things from Java and then shits on them.
Aremmes
> DC3 LS, Fuck Hyundai, now and forever
06/10/2019 at 13:52 | 1 |
/*
Fuck my life, javscript is giving me goddamn cancer, it barely even fucking works
as a langauge, as far as I can tell. Function calls inside for loops don’t even work
and I can’t find a any actual answer on StackOverFlow.
*/
I agree JS is a lethal disea
se, but I don’t understand the bit about for-loops breaking function calls. Do you have an example?
CalzoneGolem
> Aremmes
06/10/2019 at 13:56 | 0 |
I get itchy thinking about it.
DC3 LS, Fuck Hyundai, now and forever
> Aremmes
06/11/2019 at 02:17 | 0 |
Originally I had the “calcItems” function in a for loop , that passed i as an argument and iterated as many items as their w ere items (the condition of the for loop) . Bu t would only run once, so I had to put the for loop in the function itself.
Aremmes
> DC3 LS, Fuck Hyundai, now and forever
06/11/2019 at 12:46 | 0 |
If your items exist in an array, you could use the forEach() method.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach